package LeetCode._06小算法;

public class _01回文数 {
    public boolean isPalindrome(int x) {
        if(x == 0) return true;
        char[] chars = Integer.toString(x).toCharArray();
        int i = 0,j = chars.length - 1;
        while(i<j){
            if(chars[i] == chars[j]){
                i++;
                j--;
            }else{
                return false;
            }
        }
        return true;
    }
}
